STEP 5: Let's tweak our random generator so it generates numbers only between 1 and 6.

  • First, change the variable name storing the random number from my_var to outcome.
  • Then, change the second argument inside of randint() from 10 to 6. (Because a dice only has six sides.)

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)